<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
	<title>留言板首页</title>
	<link rel="stylesheet" href="Tpl/css/bootstrap.min.css">
	<style type="text/css">
        .col-md-12 .content{
        	width:100%;
        }
	</style>
</head>
<body>
    <!-- 导航条 -->
    <div>
    	
    	<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-9">
    	    <nav class="navbar navbar-inverse">
            <ul class="nav navbar-nav">
	            <li class="active"><a href="#">留言</a></li>
	            <li><a href="#">注册</a></li>
	            <li><a href="#">登录</a></li>
            </ul>
            </nav>
        </div>

        <div>
            <!-- 留言分页  这里的$db  改为从$db截取出来的一段 $_slice -->
            <?php  foreach($_slice as $key=>$value){ ?>
	        	<div class="alert <?php echo $color[array_rand($color)] ?>" role="alert">
	        	    <strong><?php echo $value['username'] ?></strong>
	        	            <?php echo $value['content'] ?>
	        	        	(<?php echo date('Y-m-d H:i:s',$value['create_time']) ?>)
	        	        <!-- 删除数据要找到相应的id，操作删除id -->
	        	        <a href="./delete.php?id=<?php echo $key ?>">删除</a>
	        	        <a href="./xiugai.php?id=<?php echo $key ?>">修改</a>
	        	</div>
	            <!-- <div class="alert" role="alert"><strong>Lucy 说：</strong>夏天来了。。。。</div>
	            <div class="alert alert-warning" role="alert"><strong>明明 说：</strong>准备高考了，压力山大。。</div>
	            <div class="alert" role="alert"><strong>她娘的婶婶 说：</strong>小王今天该娶媳妇了</div> -->
            <?php } ?>
        </div>
  
        <div>
        	<form class="navbar-form navbar-left" role="search" style="width:100%;" method="post" action="recieve.php">
        	    <div class="col-md-12">
				    <div class="form-group">
				        <label for="username">用户名</label>
				        <input type="text" class="form-control" placeholder="Jack" name="username">
				    </div>
				    <button type="submit" class="btn btn-info">留言</button>
			    </div>
			    <div class="col-md-12" style="margin-top:30px;">
			        <textarea class="form-control content" rows="3" name="content"></textarea>
			    </div>

			    <a href="index.php?page=1">第一页</a>
		        <a href="index.php?page=<?php echo ($page-1) ?>">上一页</a>
		        <a href="index.php?page=<?php echo ($page+1) ?>">下一页</a>
		        <a href="index.php">最后一页</a>
			</form>
        </div>


        



    </div>
	
</body>
</html>